<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8" />
<title>新闻中国</title>
<link href="news/css/read.css" rel="stylesheet" type="text/css" />
</head>

<body>
	<div id="header">
		<%@include file="loginPartion.jsp" %>
	</div>
	<div id="container">
		<jsp:include page="/GetSideNewsServlet"></jsp:include>
	<div class="main">
    <div class="class_type"> <img src="images/class_type.gif" alt="新闻中心" /> </div>
    <div class="content">
    <!--内容  -->
      <ul class="classlist" style="height:450px;overflow:auto;border:1px solid black;width:87.5%;padding:10px" >
        <table width="100%" align="center" >
          <tr width="100%" style="margin:30px">
            <td style=" /* border:1px solid red " */  colspan="2" align="center">${content.ntitle }</td>
          </tr>
          <tr >
            <td  colspan="2"><hr />
            </td>
          </tr>
          <tr>
            <td  align="center">作者：${content.nauthor }  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
             </a>
          </td>
            <td  align="left">发布时间：${content.ncreateDate } </td>
          </tr>          
          <tr>
            <td colspan="2" align="center"></td>
          </tr>
          <tr>
            <td colspan="2">
            ${content.ncontent }
            </td>
          </tr>
          <tr>
            <td colspan="2"><hr />
            </td>
          </tr>
        </table>
      </ul>
      
      
      
     
      <!--评论内容  -->
    <ul class="classlist" style="height:120px;overflow:auto;border:1px solid black;width:90%" >
        <table width="100%" align="center">
        	 <c:if test="${listcontent.size()==0}">
        	 	 <tr>
        			<td colspan="6"> 暂无评论！ </td>
        		</tr>
        		<tr>
        			<td colspan="6"> </td>
        		</tr>
		        <tr>
		            <td colspan="6"><hr /></td>
		        </tr>
        	 </c:if>
        	  <c:if test="${listcontent.size()!=0}">
        	  		<c:forEach items="${listcontent}" var="c" >
        	  			<tr>
        					<td colspan="6" >评论内容：${c.ccontent }</td>
        				</tr>
			        	<tr>
			        		<td >评论人：${c.cauthor } </td>
			        		<td >发表日期：：${c.cdate }</td>
			        		<td >IP：：${c.cip } </td>
			        	</tr>
			        	<tr>
			        		<td ><p style="height:20px"></p></td>
			        	</tr>
        	  		</c:forEach>
        	  </c:if>
        </table>
      </ul>
      
      
      <!--发表评论  -->
      <ul class="classlist"  style="height:200px;overflow:auto;">
        <form action="NewsContentServlet?nid=${content.nid}" method="post" onSubmit="return checkComment()">
          <table width="95%" align="center">
            <tr>
              <td style="font-weight:600;font-size:18px">发表评论 </td>
            </tr>
            <tr>
              <td> 用户名： </td>
              <td>
	              <input id="cauthor" name="cauthor" value="这家伙很懒什么也没留下"/>
                IP：
                <input name="cip" id="cip" value="${addr}" readonly="readonly" style="border:0px;"/>
              </td>
            </tr>
            <tr>
              <td colspan="2"><textarea name="ccontent" id="ccontent" cols="85" rows="5" value=""  ></textarea>
              </td>
            </tr>
            <td><input name="submit" value="发  表" type="submit"/>
              </td>
          </table>
        </form>
      </ul>
      <%-- <c:if test="${succeed==1}">
	      <script type="text/javascript">
	      	alert("评论成功");
	      	location.reload();
	      </script>
      </c:if>
       <c:if test="${succeed==0}">
	      <script type="text/javascript">
	      	alert("评论失败");
	      	location.reload();
	      </script>
      </c:if> --%>
</div>
</div>
	</div>
	<jsp:include page="/BottomPartionServlet"></jsp:include>
</body>
</html>

